﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Common
{
    public static class TestHelper
    {
        #region Validate Execution Log Directory

        public static void ValidateExecutionLogDirectory(string rootDir, string currentReleaseNo, string urlAlias)
        {
           

            if (Directory.Exists(rootDir))
            {

                if (!string.IsNullOrEmpty(currentReleaseNo))
                {
                    if (!Directory.Exists(rootDir + currentReleaseNo))
                    {
                        Directory.CreateDirectory(rootDir + currentReleaseNo);

                        Directory.CreateDirectory(rootDir + currentReleaseNo + "\\" + urlAlias);

                    }
                }
                else
                {
                    throw new Exception("Invalid release no found");
                }
            }
            else
            {
                //throw new Exception("Invalid root directory");                
                Directory.CreateDirectory(rootDir + currentReleaseNo + "\\" + urlAlias);
            }
        }

        #endregion
    }
}
